home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / dev / scsiTape.h < prev    next >
C/C++ Source or Header  |  1991-08-11  |  3KB  |  93 lines

  1. /*
  2.  * scsiTape.h --
  3.  *
  4.  *    External definitions for the tape drives on the SCSI I/O bus.
  5.  *    There are several variants of tape drives and each has an
  6.  *    associated header file that defines drive-specific sense
  7.  *    data and other info.
  8.  *
  9.  * Copyright 1986 Regents of the University of California
  10.  * All rights reserved.
  11.  * Permission to use, copy, modify, and distribute this
  12.  * software and its documentation for any purpose and without
  13.  * fee is hereby granted, provided that the above copyright
  14.  * notice appear in all copies.  The University of California
  15.  * makes no representations about the suitability of this
  16.  * software for any purpose.  It is provided "as is" without
  17.  * express or implied warranty.
  18.  *
  19.  * $Header: /sprite/src/kernel/dev/RCS/scsiTape.h,v 9.2 91/06/06 11:20:29 mendel Exp $ SPRITE (Berkeley)
  20.  */
  21.  
  22. #ifndef _SCSITAPE
  23. #define _SCSITAPE
  24.  
  25. #include "scsi.h"
  26. #include "scsiDevice.h"
  27. #include "dev/tape.h"
  28.  
  29. /*
  30.  * State info for an SCSI tape drive.  
  31.  */
  32. #define    SCSI_TAPE_DEFAULT_BLOCKSIZE    512
  33. /*
  34.  * State info for an SCSI tape drive.  This is used to map from a device
  35.  * unit number back to the SCSI controller for the drive.
  36.  */
  37. typedef struct ScsiTape {
  38.     ScsiDevice    *devPtr;        /* SCSI Device we have attached. */
  39.     int state;            /* State bits used to determine if it's open,
  40.                  * it it really exists, etc. */
  41.     char *name;            /* Type name of tape device. */
  42.     int blockSize;        /* Native block size of the drive. */
  43.     ReturnStatus (*tapeIOProc) _ARGS_((struct ScsiTape *tapePtr, int command, 
  44.     char *buffer, int *countPtr)); /* Procedure to customize tape IO. */
  45.  
  46.     ReturnStatus (*specialCmdProc) _ARGS_((struct ScsiTape *tapePtr,
  47.            int command, int count));    /* Procedure to handle special 
  48.                          * tape cmds. */
  49.     ReturnStatus (*errorProc) _ARGS_((struct ScsiTape *tapePtr,
  50.     unsigned int statusByte, int senseLength, char *senseDataPtr));
  51.                 /* Procedure to handle sense data */
  52. } ScsiTape;
  53.  
  54.  
  55.  
  56. /*
  57.  * Tape drive state:
  58.  *    SCSI_TAPE_CLOSED    The device file corresponding to the drive
  59.  *        is not open.  This inhibits read/writes, and allows opens.
  60.  *    SCSI_TAPE_OPEN        The device file is open.
  61.  *    SCSI_TAPE_AT_EOF    The file mark was hit on the last read.
  62.  *    SCSI_TAPE_WRITTEN    The last op on the tape was a write.  This is
  63.  *                used to write an end-of-tape mark before
  64.  *                closing or rewinding.
  65.  */
  66. #define SCSI_TAPE_CLOSED    0x0
  67. #define SCSI_TAPE_OPEN        0x1
  68. #define SCSI_TAPE_AT_EOF    0x2
  69. #define SCSI_TAPE_WRITTEN    0x4
  70.  
  71. /*
  72.  * SCSI_TAPE_DEFAULT_BLOCKSIZE the default block size for SCSI Tapes.
  73.  */
  74. #define    SCSI_TAPE_DEFAULT_BLOCKSIZE    512
  75.  
  76. extern int devNumSCSITapeTypes;
  77. extern ReturnStatus ((*devSCSITapeAttachProcs[]) _ARGS_((Fs_Device *devicePtr,
  78.     ScsiDevice *devPtr, ScsiTape *tapePtr)));
  79. /*
  80.  * Forward Declarations.
  81.  */
  82.  
  83. extern ReturnStatus DevSCSITapeError _ARGS_((ScsiTape *tapePtr,
  84.     unsigned int statusByte, int senseLength, char *senseDataPtr));
  85. extern ReturnStatus DevSCSITapeSpecialCmd _ARGS_((ScsiTape *tapePtr,
  86.     int command, int count));
  87. extern ReturnStatus DevSCSITapeVariableIO _ARGS_((register ScsiTape *tapePtr,
  88.     int command, char *buffer, int *countPtr));
  89. extern ReturnStatus DevSCSITapeFixedBlockIO _ARGS_((register ScsiTape *tapePtr,
  90.     int command, char *buffer, int *countPtr));
  91.  
  92. #endif /* _SCSITAPE */
  93.